<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<%@include file="/common/javascript.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>课程设定</title>
    <script type="text/javascript">
    	var dialog;
        var gridManager = null;
        
        $(function (){
        	
        	$("#dateF").ligerDateEditor();
        	
        	$("#dateT").ligerDateEditor();
        	
        	$(".l-toolbar-item").hover(
        		function (){
                	$(this).addClass("l-panel-btn-over");
            }, function (){
                	$(this).removeClass("l-panel-btn-over");
            });
        	
        	$(".l-toolbar-item").click(function(){
        		toolbarBtnItemClick($(this));
        	});

            $("#maingrid").ligerGrid({
                columns: [
                { display: '课程编号', name: 'id', align: 'center', width:'20%', minWidth: 60 },
                { display: '课程名称', name: 'title', align: 'center', width:'40%',minWidth: 120 },
                { display: '开课老师', name: 'teaName', align: 'center', width:'40%',minWidth: 60 }
                ], dataAction: 'server', url: '${ctx}/qso/coursemine/list', sortName: 'id',
                width: '100%', height: '100%', numPerPage:20,rownumbers:true,
                checkbox : true,
                heightDiff: -6
            });
             
            gridManager = $("#maingrid").ligerGetGridManager();

            $("#pageloading").hide();
        });

        function search(){
            if (!gridManager) return;
            var tea = $("#tea").val();
            var title = $("#title").val();
            gridManager.setOptions(
                { parms: [{ name: 'search_teacher', value: tea},
                          { name: 'search_title', value: title}
                ]}
            );
            gridManager.loadData(true);
        }
        
        function toolbarBtnItemClick(item) {
        	var num = gridManager.getCheckedRows().length;
        	if (!num && item.attr("toolbarid")!="add") {
            	$.ligerDialog.warn('请选择行');
            	return false;
        	}
        	var row = gridManager.getSelected();
            switch (item.attr("toolbarid")) {
                case "detail":
                	if (1 == num) {	                    	
                    		dialog=$.ligerDialog.open({url: '${ctx}/qso/coursemine/view/view?id='+row.id,height:375, width:620, showMax: true, showToggle: true, showMin: true, isResize: true, modal: true, title:"详细"});
                    	} else {
							$.ligerDialog.warn('请选择一行');
						}
                    break;
            }
        }

        function reload(){
        	gridManager.loadData();
        }
    </script>
</head>
<body style="padding:0px; overflow:hidden;"> 
<div class="l-loading" style="display:block" id="pageloading"></div> 

<div style=" width:100%" id="mainsearch">
    <div class="searchtitle">
        <span>搜索</span>
        <img src="${ctx}/static/icons/32X32/searchtool.gif"/>
        <div class="togglebtn"></div>
    </div>
    <div class="searchbox">
        <form class="l-form" id="formsearch" ligeruiid="formsearch">
        	<ul>
     			<li style="width:70px;text-align:left;">开课老师：</li>
        		<li style="width:180px;text-align:left;">
	        		<div class="l-text" style="width: 178px;">
	        			<input type="text" ligerui="{&quot;width&quot;:178}" id="tea" ltype="text" class="field l-text-field" style="width: 174px;">
	        			<div class="l-text-l"></div>
	        			<div class="l-text-r"></div>
	        		</div>
        		</li>
        		<li style="width:70px;text-align:left; margin-left:15px;">课程名称：</li>
        		<li style="width:180px;text-align:left;">
	        		<div class="l-text" style="width: 178px;">
	        			<input type="text" ligerui="{&quot;width&quot;:178}" id="title" ltype="text" class="field l-text-field" style="width: 174px;">
	        			<div class="l-text-l"></div>
	        			<div class="l-text-r"></div>
	        		</div>
        		</li>
        		<li style="width:40px;"></li>
        		<li style="margin-right:8px">
        			<div style="width:60px" class="button button2 buttonnoicon" onclick="search()">
	        			<div class="button-l"> </div>
	        			<div class="button-r"> </div> 
	        			<span>查询</span>
        			</div>
        		</li>
        	</ul>        	
        	<div class="l-clear"></div>
        </form>
    </div>
</div>

<div class="l-panel-topbar l-toolbar" ligeruiid="ToolBar1000">
	<div class="l-toolbar-item l-panel-btn l-toolbar-item-hasicon" toolbarid="detail">
		<span>查看</span>
		<div class="l-panel-btn-l"></div>
		<div class="l-panel-btn-r"></div>
		<img src="${ctx}/static/icons/silkicons/application_view_detail.png">
	</div>
	<div class="l-bar-separator"></div>
</div>

<div id="maingrid" style="margin:0; padding:0"></div>

<div style="display:none;"></div>
 
</body>
</html>
